
package com.example.swordjava;


public class Test68 {

    public static void main(String[] args) {

        int[][] a = {{1, 2, 3, 4},
                {5, 6, 7, 8},
                {9, 10, 11, 12},
                {13, 14, 15, 16}};

        System.out.println(Math.pow(1, 10));

    }

    public class TreeNode {
        int val = 0;
        TreeNode left = null;
        TreeNode right = null;

        public TreeNode(int val) {
            this.val = val;

        }
    }

    /**
     * JZ68 二叉搜索树的最近公共祖先
     */

    public int lowestCommonAncestor(TreeNode root, int p, int q) {
        // write code here
        if (p < root.val && q < root.val) return lowestCommonAncestor(root.left, p, q);
        if (p > root.val && q > root.val) return lowestCommonAncestor(root.right, p, q);

        return root.val;
    }

}














